/**
 * http://usejsdoc.org/
 * 生成建表sql
 */
let ejs = require('../../ejs/ejsUtil.js');
let path=require('path');
let fs=require('fs');
let fileName=path.resolve(__dirname,"../../../template/mysql_create_table.ejs");
let dist=path.resolve(selfConfig.root,"createTable.sql");
exports.handler=function(data){
	if(selfConfig.test)return ;
	ejs.mrenderFile(fileName,data,function (err,str) {
		if(err){
			console.log(err);
		}
		let result=str.replace(/,[\s\n]*\)/g,")");
		// log(selfConfig.writePath);
		 fs.writeFileSync(dist, result, "utf8");
		log("sql写定成功");
	});
}


